home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Small Eiffel 0.4.8 / lib_show / cecil / example2 / example.e < prev    next >
Encoding:
Text File  |  1997-04-13  |  703 b   |  35 lines  |  [TEXT/ttxt]

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class EXAMPLE
  5.    --
  6.    -- The Eiffel program is running first, then call the C program 
  7.    -- which is in charge to print the contents of `values' using
  8.    -- `item' of ARRAY[INTEGER].
  9.    --
  10.    -- To compile this example, use command :
  11.    --   
  12.    --         compile -cecil cecil.se example c_prog.c
  13.    --
  14.  
  15. creation make
  16.  
  17. feature
  18.  
  19.    make is
  20.       do
  21.      values := <<1,2,3>>;
  22.      call_c_prog(values.to_pointer);
  23.       end;
  24.  
  25. feature {NONE}
  26.  
  27.    values: ARRAY[INTEGER];
  28.  
  29.    call_c_prog(pointer_to_values: POINTER) is
  30.       external "C"
  31.       alias "c_prog"
  32.       end;
  33.  
  34. end -- EXAMPLE
  35.